<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
jala.BitTorrent
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="jala.BitTorrent";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">  <A HREF="overview-summary-BitTorrent.js.html"><FONT CLASS="NavBarFont1"><B>File</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">&nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <!--TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"-->    <!--A HREF="deprecated-list.html"--><!--FONT CLASS="NavBarFont1">Deprecated</FONT--><!--/A--><!--&nbsp;</TD-->
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"--><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<B>Jala 1.3</B>
</EM>
</TD
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="jala.AsyncRequest.html"><B>PREV CLASS</B></A><!-- 
   NEXT CLASS 
-->
&nbsp;<A HREF="jala.Captcha.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="jala.BitTorrent.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;
<SCRIPT>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>

<!-- ======== START OF CLASS DATA ======== -->
<H2>Class jala.BitTorrent</H2>
<PRE>Object
   |
   +--<b>jala.BitTorrent</b>
</PRE>


<HR>
<DL>
   <!-- Class definition -->
   <DT>class 
   <B>jala.BitTorrent</B>
   

</DL>
   
   <P>
   <BR/>This class provides methods to create a BitTorrent
 metadata file from any desired file.
 <BR/><I>Defined in <a href='overview-summary-BitTorrent.js.html'>BitTorrent.js</a></I><BR/><BR/>
   </P>
   
   <HR>

<!-- ======== NESTED CLASS SUMMARY ======== -->

<!-- ======== END NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


   

<!-- =========== END FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
   <TD>
      <CODE>
	 <B>
	    <A HREF="jala.BitTorrent.html#jala.BitTorrent()">jala.BitTorrent</A> 
	 </B>
	 (&lt;String&gt; filePath, &lt;String&gt; trackerUrl)
      </CODE>
      <BR>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      Constructs a new BitTorrent file.
      </TD>
</TR>
</TABLE>

<!-- ======== END CONSTRUCTOR SUMMARY ======== -->

&nbsp;

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>


   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;Object</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#get">get</A></B>(&lt;String&gt; name)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Get a torrent property.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;Date</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#getCreationDate">getCreationDate</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Get the creation date of the torrent.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;Number</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#getPieceLength">getPieceLength</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Get the piece length of the torrent.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;helma.File</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#getSourceFile">getSourceFile</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Returns the underlying source file.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;helma.File</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#getTorrentFile">getTorrentFile</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Returns the underlying torrent file.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;Array</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#keys">keys</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Get all available property names.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;void</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#save">save</A></B>(&lt;String&gt; filename)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Saves the torrent as file.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;void</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#set">set</A></B>(&lt;String&gt; name, &lt;Object&gt; value)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Set a torrent property.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;void</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#setCreationDate">setCreationDate</A></B>(&lt;Date&gt; date)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Set the creation date of the torrent.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;void</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#setPieceLength">setPieceLength</A></B>(&lt;Number&gt; length)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Set the piece length of the torrent.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&nbsp;String</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#toString">toString</A></B>()
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 Get a string representation of the torrent.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&lt;static&gt;&nbsp;Object</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#!s!bdecode">bdecode</A></B>(&lt;String&gt; code)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 The bdecode method.
      </TD>
   </TR>

   <TR BGCOLOR="white" CLASS="TableRowColor">
      <TD ALIGN="right" VALIGN="top" WIDTH="1%">
	 <FONT SIZE="-1">
	    <CODE>&lt;static&gt;&nbsp;String</CODE>
	 </FONT>
      </TD>
      <TD>
	 <CODE>
	    <B>
	       <A HREF="#!s!bencode">bencode</A></B>(&lt;Object&gt; obj)
	 </CODE>
	 <BR>
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 The bencode method.
      </TD>
   </TR>


</TABLE>



<P>
<!-- ========== END METHOD SUMMARY =========== -->


<!-- ============ FIELD DETAIL START =========== -->


<!-- ============ FIELD DETAIL END =========== -->

    <!-- ========= CONSTRUCTOR DETAIL START ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
   <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
      <TD COLSPAN=1>
      <FONT SIZE="+2"><B>Constructor Detail</B></FONT>
      </TD>
   </TR>
</TABLE>

<A NAME="jala.BitTorrent()"><!-- --></A><H3>
jala.BitTorrent</H3>
<PRE><B>jala.BitTorrent</B>(&lt;String&gt; filePath, &lt;String&gt; trackerUrl)</PRE>


<UL>
   Constructs a new BitTorrent file.
</UL>



   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>filePath</CODE> -  The path to the original file.  
     </UL>
   
     <UL><CODE>trackerUrl</CODE> -  The URL string of the tracker.  
     </UL>
   
   
   </UL>


<!-- Constructor return value(s) -->

   <UL>
   <B>Returns:</B>
     <UL>
     A new BitTorrent file.   
     </UL>
   </UL>

<!-- End constructor return value(s) -->

<!-- ADDITIONAL ATTRIBUTES -->

<HR/>
<!-- END ADDITIONAL ATTRIBUTES  -->

<!-- ========= CONSTRUCTOR DETAIL END ======== -->


<!-- ============ METHOD DETAIL START ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
   <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
      <TD COLSPAN=1><FONT SIZE="+2">
         <B>Method Detail</B></FONT>
      </TD>
   </TR>
</TABLE>

<!-- One single method detail entry -->

   <A NAME="get"><!-- --></A>
   <H3>get</H3>
   <PRE>Object <B>get</B>(&lt;String&gt; name)</PRE>
   
      <UL>Get a torrent property.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>name</CODE> -  The name of the property.  
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The value of the property. 
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="getCreationDate"><!-- --></A>
   <H3>getCreationDate</H3>
   <PRE>Date <B>getCreationDate</B>()</PRE>
   
      <UL>Get the creation date of the torrent.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The torrent's creation date.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="getPieceLength"><!-- --></A>
   <H3>getPieceLength</H3>
   <PRE>Number <B>getPieceLength</B>()</PRE>
   
      <UL>Get the piece length of the torrent.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The torrent's piece length.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="getSourceFile"><!-- --></A>
   <H3>getSourceFile</H3>
   <PRE>helma.File <B>getSourceFile</B>()</PRE>
   
      <UL>Returns the underlying source file.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The source file.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="getTorrentFile"><!-- --></A>
   <H3>getTorrentFile</H3>
   <PRE>helma.File <B>getTorrentFile</B>()</PRE>
   
      <UL>Returns the underlying torrent file.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The torrent file.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="keys"><!-- --></A>
   <H3>keys</H3>
   <PRE>Array <B>keys</B>()</PRE>
   
      <UL>Get all available property names.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The list of property names.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="save"><!-- --></A>
   <H3>save</H3>
   <PRE>void <B>save</B>(&lt;String&gt; filename)</PRE>
   
      <UL>Saves the torrent as file.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>filename</CODE> -  An optional name for the torrent file.  If no name is given it will be composed from name of source  file as defined in the torrent plus the ending ".torrent".       
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="set"><!-- --></A>
   <H3>set</H3>
   <PRE>void <B>set</B>(&lt;String&gt; name, &lt;Object&gt; value)</PRE>
   
      <UL>Set a torrent property.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>name</CODE> -  The name of the property.  
      </UL> 
   
     <UL><CODE>value</CODE> -  The property's value.       
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="setCreationDate"><!-- --></A>
   <H3>setCreationDate</H3>
   <PRE>void <B>setCreationDate</B>(&lt;Date&gt; date)</PRE>
   
      <UL>Set the creation date of the torrent.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>date</CODE> -  The desired creation date.       
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="setPieceLength"><!-- --></A>
   <H3>setPieceLength</H3>
   <PRE>void <B>setPieceLength</B>(&lt;Number&gt; length)</PRE>
   
      <UL>Set the piece length of the torrent.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>length</CODE> -  The desired piece length.       
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="toString"><!-- --></A>
   <H3>toString</H3>
   <PRE>String <B>toString</B>()</PRE>
   
      <UL>Get a string representation of the torrent.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The torrent as string.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="!s!bdecode"><!-- --></A>
   <H3>bdecode</H3>
   <PRE>&lt;static&gt; Object <B>bdecode</B>(&lt;String&gt; code)</PRE>
   
      <UL>The bdecode method. Turns an encoded string into
 a corresponding JavaScript object structure.
 FIXME: Handle with caution...</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>code</CODE> -  The encoded string.  
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The decoded JavaScript structure.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>

   <A NAME="!s!bencode"><!-- --></A>
   <H3>bencode</H3>
   <PRE>&lt;static&gt; String <B>bencode</B>(&lt;Object&gt; obj)</PRE>
   
      <UL>The bencode method. Turns an arbitrary JavaScript
 object structure into a corresponding encoded
 string.</UL>
   

   <!-- METHOD PARAMETERS START -->
   
   <UL>
   <B>Parameters:</B>
   
     <UL><CODE>obj</CODE> -  The target JavaScript object.  
      </UL> 
   
   </UL>
   
   <!-- METHOD PARAMETERS END -->

   
   <UL>
   <B>Returns:</B>
        <UL>
        The encoded string.   
        </UL>
   </UL>
   

   <!-- ADDITIONAL ATTRIBUTES START -->
   
   <!-- ADDITIONAL ATTRIBUTES  END -->
<HR>



<!-- ============ METHOD DETAIL END ========== -->

<!-- ========= END OF CLASS DATA ========= -->

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">  <A HREF="overview-summary-BitTorrent.js.html"><FONT CLASS="NavBarFont1"><B>File</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><b>Tree</b></FONT></A>&nbsp;</TD>
  <!--TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"-->    <!--A HREF="deprecated-list.html"--><!--FONT CLASS="NavBarFont1">Deprecated</FONT--><!--/A--><!--&nbsp;</TD-->
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<B>Jala 1.3</B>
</EM>
</TD
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="jala.AsyncRequest.html"><B>PREV CLASS</B></A><!-- 
   NEXT CLASS 
-->
&nbsp;<A HREF="jala.Captcha.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="jala.BitTorrent.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;
<SCRIPT>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>

<!-- =========== END OF NAVBAR =========== -->

<HR>
<FONT SIZE="-1">

</FONT>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Tue Jan  8 15:45:31 2008</div>
</BODY>
</HTML>
